import request from '@/utils/request'

// 查询列表
export function fetchOrderList(params) {
  return request({
    url: '/admin/orders',
    method: 'get',
    params
  })
}

// 查询单条
export function fetchOrder(id) {
  return request({
    url: `/admin/orders/${id}`,
    method: 'get'
  })
}

// 修改为配货状态
export function changeOrderPicking(id, data) {
  return request({
    url: `/admin/orders/${id}/picking`,
    method: 'patch',
    data
  })
}

// 修改为发货状态
export function changeOrderShipping(id, data) {
  return request({
    url: `/admin/orders/${id}/shipping`,
    method: 'patch',
    data
  })
}

// 修改为完成状态
export function changeOrderFinishing(id) {
  return request({
    url: `/admin/orders/${id}/finishing`,
    method: 'patch'
  })
}
